import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  ManyToOne,
  OneToOne,
} from 'typeorm';
import { User } from './user.entity';
@Entity('user_base')
export class UserBase {
  @PrimaryGeneratedColumn({ comment: '自增主键 主键id' })
  user_id: string;
  //性别
  @Column({ comment: '性别', nullable: true, default: '1', length: 1 })
  sex: string;
  // avatar头像
  @Column({ comment: '头像', nullable: true }) //非必填项
  avatar: string;
  // 昵称
  @Column({ comment: '昵称', length: 100, nullable: true })
  nickname: string;
  // 邮箱
  @Column({ comment: '邮箱', nullable: true, length: 100 })
  email: string;
  @OneToOne(() => User, (user) => user.user_base) // 定义与 User 的反向关系
  user: User;
}
